#include<iostream>
#include<cstdio>
/*
* 2024/7/23
* 21:21
* https://www.luogu.com.cn/problem/CF1369B
* author:liuqx
*/
using namespace std;
int main()
{
	int times;
	cin >> times;
	for (int index = 0; index < times; index++)
	{
		int len;
		cin >> len;
		string str;
		scanf("%s", &str);
		int left=0, right=len-1;
		for (; str[left] == '0'; left++);
		for (; str[right] == '1'; right--);
		if (left > right)
		{
			cout<<str;
			continue;
		}
		for (int i = 0; i <= left; i++)
		{
			cout<<str[i];
		}
		for (int i = right + 1; i < len; i++)
		{
			cout<<str[i];
		}
		cout<<"\n";
	}
}